//
//  MYConnectionUsVC.m
//  MuYing
//
//  Created by tbb on 2019/8/19.
//  Copyright © 2019 TBB. All rights reserved.
//

#import "MYConnectionUsVC.h"
#import "MYCommonQuestionVC.h"
#import "MYConnectionServiceVC.h"
@interface MYConnectionUsVC ()
@property (nonatomic, strong) NSArray * titleArr;
@end

@implementation MYConnectionUsVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.isNavShadow = YES;
    self.navigationItem.title = kYQLS(@"联系我们");
    self.titleArr = @[kYQLS(@"常见问题"),kYQLS(@"联系客服"),kYQLS(@"关于我们")];
}

-(void)setupView {
    [super setupView];
    self.listTableView.backgroundColor = HexColor(0xfafafa);
    kYQREGISTERTABLEVIEWNIBCELL(@"MYConnectionUsCell")
}


#pragma mark - UITableViewDelegate, UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(nonnull UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return self.titleArr.count;
}
- (nonnull UITableViewCell *)tableView:(nonnull UITableView *)tableView cellForRowAtIndexPath:(nonnull NSIndexPath *)indexPath {
    MYConnectionUsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MYConnectionUsCell"];
    cell.titleLb.text = self.titleArr[indexPath.row];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 58;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 0) {
        MYCommonQuestionVC *VC = [[MYCommonQuestionVC alloc] init];
        kYQPUSH(VC);
    }else if (indexPath.row == 1){
        MYConnectionServiceVC *serviceVC = [[MYConnectionServiceVC alloc] init];
        kYQPUSH(serviceVC);
    }else{
        MYConnectionUsDetailsVC *detailsVC = [[MYConnectionUsDetailsVC alloc]initWithNibName:@"MYConnectionUsDetailsVC" bundle:nil];
        kYQPUSH(detailsVC);
    }
}

-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.001;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    return 0.001;
}
#pragma mark - UITableViewDelegate, UITableViewDataSource end

@end
